package com.example.baselibrary.db.table;

import android.text.TextUtils;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * 群组信息表
 *
 * @author: NPF
 * @date: 2018/4/10.
 */
@DatabaseTable(tableName = "groupInfo")
public class GroupTable {
    @DatabaseField(columnName = "groupId", id = true)
    public String groupId;
    @DatabaseField(columnName = "groupNick")
    public String groupNick;
    @DatabaseField(columnName = "groupAvatar")
    public String groupAvatar;
    @DatabaseField(columnName = "groupCount")
    public String groupCount;

    public GroupTable() {
    }

    public GroupTable(String groupId, String groupNick, String groupAvatar, int groupCount) {
        this.groupId = TextUtils.isEmpty(groupId) ? "" : groupId;
        this.groupNick = TextUtils.isEmpty(groupNick) ? "" : groupNick;
        this.groupAvatar = TextUtils.isEmpty(groupAvatar) ? "" : groupAvatar;
        this.groupCount = String.valueOf(groupCount);
    }

    public GroupTable(String groupId, String groupNick, String groupAvatar) {
        this.groupId = TextUtils.isEmpty(groupId) ? "" : groupId;
        this.groupNick = TextUtils.isEmpty(groupNick) ? "" : groupNick;
        this.groupAvatar = TextUtils.isEmpty(groupAvatar) ? "" : groupAvatar;
    }

    @Override
    public String toString() {
        return "GroupTable{" +
                "groupId='" + groupId + '\'' +
                ", groupNick='" + groupNick + '\'' +
                ", groupAvatar='" + groupAvatar + '\'' +
                ", groupCount=" + groupCount +
                '}';
    }


}
